package evolution;

import hypergraph.HyperGraph;

import org.jgap.BaseGene;
import org.jgap.Configuration;
import org.jgap.Gene;
import org.jgap.InvalidConfigurationException;
import org.jgap.RandomGenerator;
import org.jgap.UnsupportedRepresentationException;

public class GraphGene extends BaseGene{
	HyperGraph graph;
	enum Mutations{
		
	}
	
	
	public GraphGene(Configuration a_configuration, HyperGraph g)
			throws InvalidConfigurationException {
		super(a_configuration);
		this.graph = g;
		// TODO Auto-generated constructor stub
	}

	@Override
	protected Object getInternalValue() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	protected Gene newGeneInternal() {
		// TODO Auto-generated method stub
		return null;
	}

	public void applyMutation(int index, double a_percentage) {
		
		
	}

	public String getPersistentRepresentation()
			throws UnsupportedOperationException {
		// TODO Auto-generated method stub
		return null;
	}

	public void setAllele(Object value) {
		graph = (HyperGraph) value;
		
	}

	public void setToRandomValue(RandomGenerator generator) {
		// TODO Auto-generated method stub
		
	}

	public void setValueFromPersistentRepresentation(String a_representation)
			throws UnsupportedOperationException,
			UnsupportedRepresentationException {
		// TODO Auto-generated method stub
		
	}

	public int compareTo(Object o) {
		if(o == null || !(o instanceof GraphGene)){
			if(graph == null) return 0;
			else return 1;
		}
		HyperGraph g = ((GraphGene)o).graph;
		return graph.getVertexCount() + graph.getEdgeCount() 
				- g.getVertexCount() - g.getEdgeCount();
	}

}
